package com.icinfo.cloud.provider.punish.controller;

import com.icinfo.cloud.provider.punish.api.client.fastcase.InformInvestigationEndFeign;
import com.icinfo.cloud.provider.punish.api.client.ucase.casemain.InvestigateFeign;
import com.icinfo.cloud.provider.punish.ucase.investigateevidence.vo.InvestigateIsEditNextStageVo;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.FastCaseAddInfoDto;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.FastCaseAddInfoTemporaryDto;
import com.icinfo.framework.common.web.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 *
 * 描述：调查终结对应的Controller类.<br>
 *
 * @author lxj
 * @date 2022/2/24
 **/
@RestController
@RequestMapping("/app/punish/inform/investigationEnd")
@Slf4j
public class InformInvestigationEndController {
    @Resource
    private InvestigateFeign investigateFeign;
    @Resource
    private InformInvestigationEndFeign informInvestigationEndFeign;
    /**
     * 【V1.11.4】描述：校验是调查取证下一环节是否可以操作
     *
     * @param caseId 用例id
     * @return {@link Result<Boolean> }
     * @author shishengyao
     * @date 2023/03/24
     */
    @GetMapping("/isCanEditNextStage")
    @ApiOperation(value = "【V1.11.2】描述：是否存在未完成的调整当事人接口记录", httpMethod = "GET")
    public Result<InvestigateIsEditNextStageVo> isCanEditNextStage(@RequestParam("caseId") String caseId) {
        return investigateFeign.isCanEditNextStage(caseId);
    }
    /**
     * 简案快办补充信息保存
     * @author liyafeng
     * @date 2023/4/20
     * @param fastCaseAddInfoDto
     * @return {@link Result< String>}
     */
    @PostMapping(value = "/saveFastCaseAddInfo",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> saveFastCaseAddInfo(@RequestBody @Validated FastCaseAddInfoDto fastCaseAddInfoDto){
        return informInvestigationEndFeign.saveFastCaseAddInfo(fastCaseAddInfoDto);
    }
    /**
     * 简案快办补充信息暂存
     * @author liyafeng
     * @date 2023/5/6
     * @param fastCaseAddInfoDto
     * @return {@link Result< String>}
     */
    @PostMapping(value = "/saveFastCaseAddInfoTemporary",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> saveFastCaseAddInfoTemporary(@RequestBody  FastCaseAddInfoDto fastCaseAddInfoDto){
        return informInvestigationEndFeign.saveFastCaseAddInfoTemporary(fastCaseAddInfoDto);
    }
    /**
     * 简案快办补充信息暂存获取
     * @author liyafeng
     * @date 2023/5/6
     * @param dto
     * @return {@link Result< FastCaseAddInfoDto>}
     */
    @PostMapping(value = "/getFastCaseAddInfoTemporary",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<FastCaseAddInfoDto> getFastCaseAddInfoTemporary(@RequestBody @Validated FastCaseAddInfoTemporaryDto dto){
        return informInvestigationEndFeign.getFastCaseAddInfoTemporary(dto);
    }
}
